home *** CD-ROM | disk | FTP | other *** search
- Path: news.primenet.com!not-for-mail
- From: gbe@primenet.com (Gary Edstrom)
- Newsgroups: comp.lang.c++
- Subject: Re: static members of a class template
- Date: 26 Mar 1996 07:21:00 -0700
- Organization: Sequoia Software
- Sender: root@primenet.com
- Message-ID: <3157fb46.251410489@news.primenet.com>
- References: <315781CB.2DD1@digex.net>
- X-Posted-By: ip030.lax.primenet.com
- X-Newsreader: Forte Agent .99d/32.182
-
- What you want can't be done in this manner. The problem below is that the
- static variable definition also needs a template declaration, but templates can
- only be applied to classes or functions, not to static variables.
-
- "Steven D. Arnold" <yami@digex.net> wrote:
-
- >Hi,
- >
- >How would you go about declaring a static member of a class template?
- >Example:
- >
- >template<class kind>
- >class simple {
- > private:
- > static kind someVar;
- >};
- >
- >simple<kind> kind simple::someVar;
- >
- >
- >This seems to follow the general pattern for defining and declaring a
- >static member, but it results in a syntax error. What's the problem?
- >
- >Thanks in advance for any advice!
- >
- >-Steve-
-
- --
- Gary Edstrom <gbe@primenet.com> | Sequoia Software
- PO Box 9573 | Programming & Technical Services
- Glendale CA 91226-0573 | PGP Key ID: 0x1A0D44BD
- PGP Fingerprint: 72 AA 4F 73 05 53 89 C6 8A EE F4 EE D1 C0 13 8D
-